import 'package:base/common/chat_ui/utils/typedefs.dart';
import 'package:flutter/material.dart';





/// 定义输入框操作按钮的数据结构
class ComposerAction {
  /// 操作按钮的图标
  final Widget icon;

  /// 操作按钮的颜色
  final Color? color;

  /// 点击回调
  final VoidCallback? onTap;

  /// 是否是发送按钮
  final ComposerActionType type;

  /// 创建操作按钮
  const ComposerAction({
    required this.icon,
    this.color,
    this.onTap,
    this.type = ComposerActionType.none,
  });

  /// 创建默认的发送按钮
  static ComposerAction defaultSend({
    Color? color,
    VoidCallback? onTap,
  }) {
    return ComposerAction(
      icon: const Icon(Icons.send),
      color: color,
      onTap: onTap,
      type: ComposerActionType.send,
    );
  }

  /// 创建默认的附件按钮
  static ComposerAction defaultAttachment({
    Color? color,
    VoidCallback? onTap,
  }) {
    return ComposerAction(
      icon: const Icon(Icons.attachment),
      color: color,
      onTap: onTap,
    );
  }
}
